/*
* ECARX Technology Limited is the owner of the copyright and the trade secret of this software.
* Without permission, no one has the right to obtain, disclose or use this software in any way.
*/

package ecarx.xsf.notificationcenter.task;

import static android.os.Process.setThreadPriority;

public final class PriorityThread extends Thread {
    private final int priority;

    public PriorityThread(int priority, String name, Runnable runnable) {
        super(runnable, name);
        this.priority = priority;
    }

    @Override
    public void run() {
        if (priority != NORM_PRIORITY) {
            setThreadPriority(priority);
        }
        super.run();
    }
}
